
est clear

***************************
***   Placebo post #1   ***
***************************

gen fake_post = 0
replace fake_post = 0.25 if birthyear >= 1969 & birthyear != .
replace fake_post = 0.5 if birthyear >= 1970 & birthyear != .
replace fake_post = 0.75 if birthyear >= 1971 & birthyear != .
replace fake_post = 1 if birthyear >= 1972 & birthyear != .

gen fakeinst = fake_post*treat2_10_inc
egen f_std = std(fakeinst)
drop fakeinst
ren f_std fakeinst
label var fakeinst "Post $\times$ Intensity"


* main effects

foreach var of varlist economic_index information participation_index dem_checks_on_pres {
	quietly eststo: areg `var' fakeinst i.birthyear_control i.year_survey_control fake_post treat2_10_inc wolof-others urbrur2 male if birthyear_control >= 1953 & birthyear_control <= 1980, absorb(locale_gender) cluster(locale_3_control)
	
	noisily: lincom fakeinst
	quietly summ `var' if e(sample)
	estadd scalar vmean = r(mean)
}

* het effects

foreach var of varlist participate_index  dem_gov dem_support dem_checks_on_pres dem_institutions  {
	quietly eststo: reg `var' fakeinst c.fakeinst#c.W i.birthyear_control##c.W i.locale_gender##c.W c.fake_post##c.W c.treat2_10_inc##c.W i.year_survey_control wolof-others male urbrur2 if birthyear_control >= 1953 & birthyear_control <= 1980, cluster(locale_3_control)

	noisily: lincom fakeinst
	noisily: lincom c.fakeinst#c.W
	
	quietly summ `var' if e(sample)
	estadd scalar vmean = r(mean)
	
}


***************************
***   Placebo post #2   ***
***************************

drop fake_post 
drop fakeinst

gen fake_post = 0
replace fake_post = 0.25 if birthyear >= 1974 & birthyear != .
replace fake_post = 0.5 if birthyear >= 1975 & birthyear != .
replace fake_post = 0.75 if birthyear >= 1976 & birthyear != .
replace fake_post = 1 if birthyear >= 1977 & birthyear != .

gen fakeinst = fake_post*treat2_10_inc
egen f_std = std(fakeinst)
drop fakeinst
ren f_std fakeinst
label var fakeinst "Post $\times$ Intensity"

* main effects

foreach var of varlist economic_index information participation_index dem_checks_on_pres {
	
	display " "
	display " "
	display " "
	display "Table A19: `var'"
	
	quietly eststo: areg `var' fakeinst i.birthyear_control i.year_survey_control fake_post treat2_10_inc wolof-others urbrur2 male if birthyear_control >= 1958 & birthyear_control <= 1985, absorb(locale_gender) cluster(locale_3_control)
	
	noisily: lincom fakeinst
	quietly summ `var' if e(sample)
	estadd scalar vmean = r(mean)
}

* het effects

foreach var of varlist participate_index  dem_gov dem_support dem_checks_on_pres dem_institutions {
	
	display " "
	display " "
	display " "
	display "Table A20: `var'"
	
	quietly eststo: reg `var' fakeinst c.fakeinst#c.W i.birthyear_control##c.W i.locale_gender##c.W c.fake_post##c.W c.treat2_10_inc##c.W i.year_survey_control wolof-others male urbrur2 if birthyear_control >= 1958 & birthyear_control <= 1985, cluster(locale_3_control)

	noisily: lincom fakeinst
	noisily: lincom c.fakeinst#c.W
	
	quietly summ `var' if e(sample)
	estadd scalar vmean = r(mean)
}




local numbers1 "& (1) & (2) & (3) & (4) \\"
local robust1 "\textbf{Placebo year = 1969} & \multicolumn{1}{c}{Economic index} &  \multicolumn{1}{c}{Interest index}  &  \multicolumn{1}{c}{Participate index}  &  \multicolumn{1}{c}{Checks on pres} \\  \midrule"
local robust2 "\midrule \\ \textbf{Placebo year = 1974} & \multicolumn{1}{c}{Economic index} &  \multicolumn{1}{c}{Interest index}  &  \multicolumn{1}{c}{Participate index}  &  \multicolumn{1}{c}{Checks on pres} \\  \midrule"
local gap ""

esttab est1 est2 est3 est4 using "tables/placebo.tex", replace b(3) se(3) ar(3) ///
stats(N vmean, fmt(0 3 3 "") labels(`"Observations"' `"DV Mean"')) nonumber posthead("`numbers1'" "`robust1'") ///
f label nomtitles nogaps booktabs noobs compress star(* 0.10 ** 0.05 *** 0.01) keep(fakeinst)

esttab est10 est11 est12 est13 using "tables/placebo.tex", append b(3) se(3) ar(3) ///
stats(N vmean, fmt(0 3 3 "") labels(`"Observations"' `"DV Mean"')) nonumber posthead("`gap'" "`robust2'") ///
f label nomtitles nogaps booktabs noobs compress star(* 0.10 ** 0.05 *** 0.01) keep(fakeinst)




local numbers2 "& (1) & (2) & (3) & (4) & (5) \\ \midrule"
local robust3 "\textbf{Placebo year = 1969} & \multicolumn{1}{c}{Participate index}   &  \multicolumn{1}{c}{Dem quality index}  &  \multicolumn{1}{c}{Dem support index} &  \multicolumn{1}{c}{Checks on pres index}  &  \multicolumn{1}{c}{Dem inst index} \\  \midrule"
local robust4 "\midrule \\ \textbf{Placebo year = 1974} &  \multicolumn{1}{c}{Participate index}   &  \multicolumn{1}{c}{Dem quality index}  &  \multicolumn{1}{c}{Dem support index} &  \multicolumn{1}{c}{Checks on pres index}  &  \multicolumn{1}{c}{Dem inst index} \\  \midrule"

esttab est5 est6 est7 est8 est9 using "tables/placebo_het.tex", replace b(3) se(3) ar(3) interaction("$\times$") ///
stats(N vmean, fmt(0 3 3 "") labels(`"Observations"' `"DV Mean"')) nonumber posthead("`numbers2'" "`robust3'") ///
f label nomtitles nogaps booktabs noobs compress star(* 0.10 ** 0.05 *** 0.01) keep(fakeinst c.fakeinst#c.W)

esttab est14 est15 est16 est17 est18 using "tables/placebo_het.tex", append b(3) se(3) ar(3) interaction("$\times$") ///
stats(N vmean, fmt(0 3 3 "") labels(`"Observations"' `"DV Mean"')) nonumber posthead("`gap'" "`robust4'") ///
f label nomtitles nogaps booktabs noobs compress star(* 0.10 ** 0.05 *** 0.01) keep(fakeinst c.fakeinst#c.W)



